package com.example.day01.mvvm;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import com.example.day01.BannerEntity;
import com.example.day01.VideoEntity;

public class BannerViewModel extends ViewModel {
    //定义两个变量，用来接收repo返回的数据
    public MutableLiveData<BannerEntity> success = new MutableLiveData<>();
    public MutableLiveData<String> fail = new MutableLiveData<>();


    public MutableLiveData<VideoEntity> videoSuccess = new MutableLiveData<>();
    public MutableLiveData<String> videoFail = new MutableLiveData<>();
    BannerRepo repo = new BannerRepo();
    public void banner(){
        repo.banner(success,fail);
    }
    public void video(){
        repo.video(videoSuccess,videoFail);
    }
}
